#pragma once
#include "RigidPoly.h"
#include "Polygon.h"

namespace poly
{
	// Buoyancy constraint
	// usage:
	// add the rigid polygon bodies to the bodies set
	// add the polygons representing static fluid to the buoyant set
	class Buoyancy : public IConstraint
	{
	public:
		Buoyancy();
		typedef std::set<RigidPoly*> RigidPolySet;
		typedef std::set<Polygon*> PolygonSet;

		void apply( float dt );

		PolygonSet buoyant;
		RigidPolySet bodies;
		float3 forceDensity;
	};
}
